/*Human or Not
*Replication File
05 August 2020*/


log using "PSRMreplication.log", replace

/*Study 1*/

use humanornots1data.dta, clear

*Table 2
reg cas1 sanitize republican ideo2
reg cas2 sanitize republican ideo2
reg cas3 sanitize republican ideo2
reg ucas1 sanitize republican ideo2
reg ucas2 sanitize republican ideo2

*Footnote 2
reg ucas3 sanitize

*Fig 1a
medeff (regress ucas1 sanitize) (regress cas1 ucas1 sanitize), mediate(ucas1) treat(sanitize) sims(1000)

medsens (regress ucas1 sanitize) (regress cas1 ucas1 sanitize), mediate(ucas1) treat(sanitize) sims(1000) eps(.01)

twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line  _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p) - Figure 1a")



*Fig 1b
medeff (regress ucas2 sanitize) (regress cas2 ucas2 sanitize), mediate(ucas2) treat(sanitize) sims(1000)

medsens  (regress ucas2 sanitize) (regress cas2 ucas2 sanitize), mediate(ucas2) treat(sanitize) sims(1000) eps(.01)

twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line  _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p) - Figure 1b")



*Ideology moderation

reg cas1 c.sanitize c.ideo2 c.sanitize#c.ideo2 republican
reg cas2 c.sanitize c.ideo2 c.sanitize#c.ideo2 republican
reg cas3 c.sanitize c.ideo2 c.sanitize#c.ideo2 republican
reg ucas1 c.sanitize c.ideo2 c.sanitize#c.ideo2 republican
reg ucas2 c.sanitize c.ideo2 c.sanitize#c.ideo2 republican



/*Study 2*/

use humanornots2.dta, clear

*Table 3
reg sup_int c.wot_dh conserv rep  if time_read>10&wot_textr_2>.18
reg wot_dv_2 c.wot_dh conserv  rep  if time_read>10&wot_textr_2>.18
reg wot_dv_4 c.wot_dh conserv rep  if time_read>10&wot_textr_2>.18

gen low_believe = .
replace low_believe = 1 if wot_textr_2<=.18
replace low_believe = 0 if wot_textr_2>.18

reg sup_int c.wot_dh conserv rep low_believe if time_read>10
reg wot_dv_2 c.wot_dh conserv rep low_believe if time_read>10
reg wot_dv_4 c.wot_dh conserv rep low_believe if time_read>10

ttest wot_textr_2, by(wot_dh)

*Differences on exlusion

gen include = .
replace include = 1 if time_read>10
replace include = 1 if wot_textr_2>.18
replace include = 0 if time_read<=10|wot_textr_2<=.18
replace include = . if time_read==.
replace include = . if wot_textr_2==.

ttest rep, by(include)
ttest conserv, by(include)
ttest educ, by(include)
ttest female, by(include)


*Ideology moderation

reg sup_int c.wot_dh c.conserv c.wot_dh#c.conserv rep  if time_read>10&wot_textr_2>.18
reg wot_dv_2 c.wot_dh c.conserv c.wot_dh#c.conserv rep  if time_read>10&wot_textr_2>.18
reg wot_dv_4 c.wot_dh c.conserv c.wot_dh#c.conserv rep  if time_read>10&wot_textr_2>.18


*Emotions measures (page 13)

reg hon_fear c.wot_dh conserv  rep if time_read>10&wot_textr_2>.18
reg hon_anger c.wot_dh conserv  rep if time_read>10&wot_textr_2>.18
reg hon_disgust c.wot_dh conserv  rep if time_read>10&wot_textr_2>.18


reg hon_fear c.wot_dh conserv  rep if time_read>10
reg hon_anger c.wot_dh conserv  rep if time_read>10
reg hon_disgust c.wot_dh conserv  rep if time_read>10

log close
